v1=reshape(d1,15,3223,15);
v2=reshape(d2,15,277,15);

jointsp=[0,1;3,6;2,3;2,6;2,9;2,12;3,4;6,7;4,5;7,8;9,12;9,10;12,13;10,11;13,14];
joints=jointsp+1;
joint{1}='head';
joint{2}='neck';
joint{3}='torso';
joint{4}='left shoulder';
joint{5}='left elbow';
joint{6}='left hand';
joint{7}='right shoulder';
joint{8}='right elbow';
joint{9}='right hand';
joint{10}='left hip';
joint{11}='left knee';
joint{12}='left foot';
joint{13}='right hip';
joint{14}='right knee';
joint{15}='right foot';


for i=1:1
    for j=(i+1):(i+2)
        h1=figure('visible','on');
        plot(v1(i,:,j),'.r')
        hold on;
        plot(v2(i,:,j),'.b')
        title({'Line Plot - data set 1(red) and 2(blue)';[joint{i},' - ',joint{j}]});
        xlabel('Message Number');
        ylabel('Distance');
        legend(strcat('Data Set 1, mean:',num2str(mean(v1(i,:,j)))),strcat('Data Set 2, mean:',num2str(mean(v2(i,:,j)))))
        print(h1, '-dpng', strcat('plot_1_2_',joint{i},'_',joint{j},'.png'));
        hold off;
    end
end